home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / UTILITY / CMDED2E6.ARJ / CMDEDIT.DOC < prev    next >
Text File  |  1992-06-30  |  38KB  |  904 lines

  1.  
  2.                               CMDEDIT.DOC
  3.  
  4.                      Documentation for CMDEDIT.COM
  5.  
  6.         Command editor Version 2.0 with extensions at version 6.
  7.  
  8.                               June,  1992
  9.  
  10. CONTENTS
  11.  
  12.         * AUTHORS
  13.         * DISCLAIMER
  14.         * NOTE
  15.         * PURPOSE
  16.         * SYNTAX
  17.         * SUMMARY OF OPTIONAL PARAMETERS
  18.         * SUMMARY OF EDITING COMMANDS
  19.         * DESCRIPTION OF OPTIONAL PARAMETERS
  20.         * DESCRIPTION OF SELECTED EDITING COMMANDS
  21.         * INTERNAL COMMANDS
  22.         * INITIALIZATION FILE
  23.         * WINDOWS 3.x
  24.         * MISCELLANEOUS
  25.         * UPGRADING
  26.         * COMPILING THE SOURCE CODE
  27.         * VERSION HISTORY
  28.         * ACKNOWLEDGEMENTS
  29.         * BUGS
  30.  
  31.  
  32. AUTHORS
  33.         The original "CMDEDIT V2.0" by Ashok P. Nadkarni appeared in
  34.         PC Magazine, Vol. 9, No. 16
  35.  
  36.         Extensions by:
  37.         David Abbott            dfa@muon.ph.unimelb.edu.au
  38.         Wayne Davison           davison@borland.com
  39.  
  40.  
  41. DISCLAIMER
  42.         Although the authors of the extensions to this program and its
  43.         documentation have spent time testing their modifications,  they make
  44.         no warranties either expressed or implied regarding the modifications
  45.         made,  their suitability for any purpose,  or even that they will
  46.         function as expected.  In no event shall these authors be liable for
  47.         any damage caused by the use of, or any defects within, the software.
  48.  
  49.  
  50. NOTE
  51.         This version of CMDEDIT supersedes both of the following versions:
  52.         CMDEDIT 2.0 with extensions by D. Abbott at version 5, and CMDEDIT
  53.         2.1wd (an extension of CMDEDIT 2.0 by W. Davison).
  54.  
  55.         See also the UPGRADING and VERSION HISTORY sections of this document.
  56.  
  57.  
  58. PURPOSE
  59.         A TSR (terminate & stay resident) utility that supplies full editing
  60.         features to the dos interface; stacks commands and drive/directory
  61.         pairs for recall; supports definable symbols and variables, and
  62.         programmable function-key definitions and macros; provides optional
  63.         autocompletion of commands and filenames; and enables changing drives
  64.         and directories simultaneously.
  65.  
  66.  
  67. SYNTAX
  68.         CMDEDIT [/a] [/c] [/g] [/i] [/k] [/n] [/o] [/r] [/t] [/u] [/w] [/x]
  69.         [/y] [/z] [/p X] [/l N0] [/d N1] [/m N2] [/b N3] [/s N4] [/ffilename]
  70.  
  71.         Remark:
  72.         CMDEDIT can be entered at the DOS prompt, but is normally installed
  73.         through the AUTOEXEC.BAT file.
  74.  
  75.  
  76. SUMMARY OF OPTIONAL PARAMETERS
  77.  
  78.         /a Disable appending backslash when completing directory name
  79.         /c Swap cursor type used in insert and over-type modes
  80.         /g Use silent mode (default beeps on error)
  81.         /i Use insert mode (default over-type)
  82.         /k Use ESC key for filename completion (in addition to TAB & ^\)
  83.         /n No existence check (default checks for previous install)
  84.         /o Do not install (default will install if not already)
  85.         /r Auto recall mode (default off)
  86.         /t Disable all macro and symbol translation (default enabled)
  87.         /u uninstall CMDEDIT from memory if possible
  88.         /w Use alternate error message display
  89.         /x Keystrokes are read in via a raw read
  90.         /y Tab cycles through ambiguous matches rather than listing them
  91.         /z Disable CMDEDIT (default enabled)
  92.  
  93.         /p Set the ignore macro character (default X is ;)
  94.         /l Minimum command length to store in buffer (default N0 is 1)
  95.  
  96.         /d DOS history (command stack) buffer size (default N1 is 512 bytes)
  97.         /m Macro buffer size (default N2 is 512 bytes)
  98.         /b Symbol buffer size (default N3 is 512 bytes)
  99.         /s Directory Stack size (default N4 is 256 bytes)
  100.         /f Initialization file to read at start-up (default none)
  101.  
  102.  
  103. SUMMARY OF EDITING COMMANDS
  104.  
  105.         ^U or Up-Arrow          Recall previous command in history buffer
  106.         ^N or Down-Arrow        Recall next command in history buffer
  107.         ^F or Right-Arrow       Cursor forward (character).
  108.         ^B or Left-Arrow        Cursor backward (character)
  109.         ^Right-Arrow            Cursor forward (word)
  110.         ^LeftArrow              Cursor backward (word)
  111.         ^E or End               Cursor to end of line.
  112.         ^A or Home              Cursor to start of line.
  113.         ^D or Del               Delete character at the cursor.
  114.         ^H or Backspace         Delete previous character
  115.         ^T                      Swap character under cursor with previous char.
  116.         ^W                      Delete word at right of cursor.
  117.         ^L                      Deletes word at left of cursor.
  118.         ^[ or ESC               Erase entire command line (unless /k option
  119.                                 specified on start-up).
  120.         ^C                      Cancel entire command line
  121.         ^BREAK                  Terminates a running macro
  122.         ^K                      Delete from cursor to end of line
  123.         ^X                      Delete from cursor to start of line
  124.         ^O                      Delete from cursor to EOL and
  125.                                 execute line.
  126.         ^G                      Erase entire line but keep in stack.
  127.         ^^ (CTRL-6)             Execute line, but do not store or
  128.                                 display (for passwords).
  129.         INS                     Toggle insert/over-type modes.
  130.         ^I or TAB and ^\        Expand partial filename or directory name
  131.         ^J                      Replace variables with values.
  132.         ^Q                      Place succeeding CTRL-key on
  133.                                 line as literal instead of command
  134.         ^R                      Recall matching command from hist. buffer
  135.         ^V                      Same as ^R but searches forward through history
  136.         ^Y                      Toggles auto-recall mode on/off
  137.         ^Z                      Put end-of-file marker on line.
  138.         ^_ (CTRL-underscore)    Toggles macro and symbol translation off/on
  139.  
  140.  
  141. DESCRIPTION OF OPTIONAL PARAMETERS
  142.  
  143.         Option /a       Append backslash toggle
  144.  
  145.         This toggle disables/enables the appending of a backslash to directory
  146.         names when using filename completion.  If backslash appending is
  147.         disabled, nothing at all is appended to directory names but a space is
  148.         still appended to regular filenames.
  149.  
  150.         Default: CMDEDIT normally appends a trailing backslash to a directory
  151.                  name.
  152.  
  153.  
  154.         Option /c       Cursor type exchange
  155.  
  156.         Swap cursor types usually used in insert and over-type modes. The
  157.         default over-type mode cursor is an underscore,  whilst the default
  158.         insert mode cursor is a block.
  159.  
  160.  
  161.         Option /g       Go silent
  162.  
  163.         This will suppress the error beep when an error occurs.
  164.  
  165.  
  166.         Option /i       Insert mode for editing
  167.  
  168.         Use insert mode when editing.
  169.         The default editing mode is over-type.
  170.  
  171.  
  172.         Option /k       ESC Key usage
  173.  
  174.         This option enables the ESC key to be used for filename completion in
  175.         addition to the TAB key.  The actual behaviour depends on whether or
  176.         not /y has also been specified (see /y for more details).
  177.         Normally,  ESC functions as a clear-line command.  If you use this
  178.         option,  you can always type CTRL-C to cancel a line you've typed.
  179.  
  180.  
  181.         Option /n       New installation
  182.  
  183.         This will install CMDEDIT without checking for a previous
  184.         installation. This option forces the current invocation to remain
  185.         resident - even if CMDEDIT is already resident. The option should only
  186.         be used if CMDEDIT incorrectly detects the presence of a resident
  187.         incarnation.
  188.  
  189.         WARNING:  PROBLEMS MAY OCCUR IF CMDEDIT IS RUN AGAIN TO CHANGE
  190.         INSTALLED OPTIONS, AS THE INCARNATION CHANGED MAY IN FACT BE THE
  191.         SPURIOUS DETECTION.  See also BUGS.
  192.  
  193.         Default: Before CMDEDIT makes itself resident it will do a somewhat
  194.         primitive check to see whether it has already been installed. If it
  195.         is installed already then it will not install itself again.
  196.  
  197.  
  198.         Option /o       Option change only mode
  199.  
  200.         This prevents the current invocation of CMDEDIT becoming resident even
  201.         if it cannot detect a resident incarnation.  This may be useful when
  202.         changing CMDEDIT options from a batch file.  If CMDEDIT had not
  203.         previously been installed,  the new invocation would normally make
  204.         itself resident which may not be desired;  /o prevents this.
  205.  
  206.         Default: CMDEDIT installs itself as a TSR if it does not detect an
  207.         already resident incarnation.
  208.  
  209.  
  210.         Option /r       Auto-Recall mode enable
  211.  
  212.         A history buffer search is made as each letter is typed in.  Note that
  213.         command lines shorter than the minimum number of characters specified
  214.         with the /l switch are not stored on the stack.  This option can also
  215.         be toggled using ^Y after CMDEDIT has been loaded.  For a more
  216.         complete description,  see the ^Y command later in this document.
  217.  
  218.  
  219.         Option /t       Translation disable toggle
  220.  
  221.         Disables all macro and symbol translation.
  222.         Default: Translation is enabled.
  223.         This option can also be toggled by typing ^_ (CTRL-underscore) while
  224.         CMDEDIT is running.
  225.  
  226.  
  227.         Option /u       Uninstall CMDEDIT from memory
  228.  
  229.         Disables CMDEDIT and removes it from memory if possible (i.e. if no
  230.         other TSR's have been loaded after CMDEDIT).
  231.  
  232.  
  233.         Option /w       Write alternate error message
  234.  
  235.         This will yield a different error message display.
  236.         Usually, an error message is displayed like this:
  237.         "*** CMDEDIT : <error message> Any ongoing macro aborted! ***"
  238.         The alternate display only shows the <error message> and the command
  239.         line which caused the error is left displayed on the screen.
  240.  
  241.  
  242.         Option /x       Use a raw getkey function
  243.  
  244.         Modifies the getkey function to read raw keystrokes.  This allows the
  245.         entry of ^P, which functions the same as the ^U key.  To toggle printer
  246.         logging, type ^C ^P.  To type a ^C while at the command prompt, press
  247.         ^C ^C.  During program execution ^P and ^C are not changed from their
  248.         normal behaviour.
  249.  
  250.  
  251.         Option /y       cYcle through filename matches
  252.  
  253.         Along with /k, this switch selects which keys should be used for the
  254.         two possible filename completion modes as follows:
  255.  
  256.         Default (no /k or /y):  TAB lists,  ^\ cycles
  257.                       /y only:  TAB cycles, ^\ lists
  258.                       /k only:  TAB lists,  ESC and ^\ cycles
  259.                     /k and /y:  TAB cycles, ESC and ^\ lists
  260.  
  261.         See the description of the TAB key for more information about the
  262.         filename completion modes.
  263.  
  264.  
  265.         Option /z        Zero interference
  266.  
  267.         This toggle disables CMDEDIT completely,  but leaves it resident.
  268.         To re-enable CMDEDIT,  call with /z a second time.
  269.  
  270.  
  271.         Option /p <char>        Prefix character for translation ignoring
  272.  
  273.         This sets the ignore macro character. If this character is the first
  274.         character on the input line (thus prefixing the input) then no macro
  275.         substitution will be performed.  You can define the macro ignore
  276.         character to be a space.  To do this,  however, you must put it in
  277.         quotes.  i.e. use  CMDEDIT /p" "
  278.  
  279.         Default: ";"
  280.  
  281.  
  282.         Option /l <length>      Length of command to store in history buffer
  283.  
  284.         Sets the minimum length for command lines which are to be stored in
  285.         the DOS history buffer (command stack) to <length>.  Thus command
  286.         lines with less than <length> characters are not stored.
  287.         Default: 1  (i.e. all commands are stored).
  288.  
  289.  
  290.         Option /d <size>        DOS history buffer size
  291.  
  292.         Sets the size of the DOS history buffer (command stack) to <size>
  293.         bytes.
  294.         Default: 512
  295.  
  296.  
  297.         Option /m <size>        Macro buffer size
  298.  
  299.         Sets the size of the macro buffer to <size> bytes.
  300.         Default: 512
  301.  
  302.  
  303.         Option /b <size>        Symbol Buffer size
  304.  
  305.         Sets the size of the symbol buffer to <size> bytes.
  306.         Default: 512
  307.  
  308.  
  309.         Option /s <size>        Stack for directories
  310.  
  311.         Set the directory stack size to <size> bytes.
  312.         Default: 128
  313.  
  314.  
  315.         Option /f<filename>     File for initialization
  316.  
  317.         Initialization file to read at start-up.  Note that there is no space
  318.         between the /f switch and the filename itself.  See the INITIALIZATION
  319.         FILE section later in this document.
  320.         Default: <none>
  321.  
  322.  
  323. DESCRIPTION OF SELECTED EDITING COMMANDS
  324.  
  325.  
  326.         ^U or Up-Arrow
  327.  
  328.         Puts the previous command from the DOS history buffer (relative to the
  329.         current pointer in the buffer) onto the command line. If there is no
  330.         previous command in the buffer then an error beep is issued and the
  331.         buffer pointer is returned to the last command executed (i.e. the
  332.         stack behaves in a cyclic manner).  The beep can be avoided by
  333.         starting CMDEDIT with the /g silent mode toggle.
  334.  
  335.  
  336.         ^N or Down-Arrow
  337.  
  338.         Analogous to above,  but steps forward in the history buffer.
  339.  
  340.  
  341.         INS             toggle mode type
  342.  
  343.         Toggles the command line editing mode between insert mode and
  344.         over-type mode. Inserting a character in insert mode will push all
  345.         characters including the one under the cursor one place to the right
  346.         and then insert the typed character.
  347.  
  348.  
  349.         ^[ or ESC       erase line
  350.  
  351.         This erases the command line.  Useful for erasing all rubbish on the
  352.         command line and starting anew.
  353.         Note: If you start CMDEDIT with the /k option then ESC will instead be
  354.         used to perform filename completion.  In that case ^C or ^X are good
  355.         alternatives.
  356.  
  357.  
  358.         ^C and ^BREAK
  359.  
  360.         ^C will cancel a line,  or terminate the current command in a running
  361.         macro.  In the latter case,  macro execution will continue with the
  362.         next command.  ^BREAK will completely terminate a running macro.
  363.         Note that the /x switch modifies this default ^C behaviour.
  364.  
  365.  
  366.         ^G              copy line & erase line
  367.  
  368.         This copies the current line into the history buffer and then erases
  369.         it. This is useful when you do not want to execute what you've just
  370.         typed but still want to remember it for later use.
  371.  
  372.  
  373.         ^^              execute line & erase line
  374.  
  375.         This will execute your input but will erase the line and not copy it
  376.         into the history buffer. Useful if you do not want CMDEDIT to remember
  377.         a typed password for others.
  378.         On a PC,  this keystroke is equivalent to CTRL-6.
  379.  
  380.  
  381.         ^I or TAB       filename completion
  382.  
  383.         CMDEDIT examines the word to the left of the cursor and tries to
  384.         complete its filename. The word may contain a full disk and path
  385.         specification. If several files match, only the common part of their
  386.         names will be placed on the command line.  If no further characters
  387.         can unambiguously be added to the line and TAB is struck,  CMDEDIT
  388.         behaves in one of two ways depending on the mode selected with the /y
  389.         and /k switches.
  390.  
  391.         In list mode,  a list of all possible matching filenames is displayed.
  392.         In cycle mode, CMDEDIT will complete as much as it can on the first
  393.         TAB or if no more characters can be added will leave the line
  394.         unchanged.  On subsequent consecutive TAB's,  CMDEDIT will then cycle
  395.         through all possible matches.
  396.  
  397.         If the matching name is a directory, a \ or / is appended, making
  398.         it easier to enter a complete path specification (unless this has been
  399.         disabled with the /a command line option,  in which case nothing is
  400.         appended).  If the matching name is not a directory, then a space is
  401.         placed after the name.
  402.  
  403.         Note that if you are using the DOS cd command to change directories,
  404.         the trailing backslash will cause an error.  You can either delete the
  405.         added slash,  use CMDEDIT's own directory commands which permit a
  406.         trailing slash, or make use of the dosify function (see the @ internal
  407.         command).  Remember you can also define a symbol string if you would
  408.         like to replace or modify DOS's cd command as follows:
  409.  
  410.                 defs cd chd
  411.         or      defs cd @cd
  412.  
  413.  
  414.         ^J              replace variables with values
  415.  
  416.         Causes CMDEDIT to look in the command line for any CMDEDIT or DOS
  417.         environment variables and to replace them with their string values.
  418.         Environment variables should be enclosed in % signs as they would be
  419.         in batch files.  CMDEDIT automatically expands such environment
  420.         variables when executing commands even if the ^J command is not used.
  421.         ^J is useful however to see exactly how a command line is expanded
  422.         before executing it.
  423.  
  424.  
  425.         ^Q              quote next character
  426.  
  427.         If you intend to put any of the characters onto the command line which
  428.         are usually interpreted as commands by CMDEDIT (for example most
  429.         control key combinations) then you should precede them immediately
  430.         with ^Q.  For example:  To put ^T as a character on the command line
  431.         you should type ^Q^T.
  432.  
  433.  
  434.         ^R              recall matching command (backward search)
  435.  
  436.         Commands beginning with one or more user-typed letters can be recalled
  437.         with this command.  CMDEDIT searches backwards through the history
  438.         buffer, successively placing each matching older command on the command
  439.         line with each ^R issued.
  440.  
  441.  
  442.         ^V              recall matching command (forward search)
  443.  
  444.         Similar to ^R,  but searches forward through the history buffer
  445.  
  446.  
  447.         ^Y              auto-recall mode toggle
  448.  
  449.         CMDEDIT continuously tries to match the current line with the most
  450.         recent match from the history buffer.  As you keep typing,  CMDEDIT
  451.         will keep replacing the line with the most recent line from the history
  452.         buffer that matches the characters you have typed up to that point.
  453.         When the line displayed matches the one you want to execute,  simply
  454.         hit Enter.  If as you type on there is no longer any possible match in
  455.         the history buffer,  the remainder of the line is cleared from the
  456.         cursor (possibly erasing a previous partial match).  The easiest way
  457.         to learn how this works in practice is to try it out.
  458.         Auto-recall can also be toggled using the /r command line switch.
  459.  
  460.  
  461.         ^_              toggle macro translation
  462.  
  463.         This toggles macro and symbol translation on/off in a manner similar
  464.         to the /t command line toggle.
  465.         On a PC this keystroke is equivalent to CTRL-minus.
  466.  
  467.  
  468.         ^\              Alternative filename completion
  469.  
  470.         Filename completion in the mode not being used by TAB
  471.         See also TAB,  and /y
  472.  
  473.  
  474. INTERNAL COMMANDS
  475.  
  476.         Internal CMDEDIT commands are given on the command line after the DOS
  477.         prompt. A command is always the first word on the command line. All
  478.         words following a command are called parameters.
  479.  
  480.  
  481.         DEFS <symbol> <string>
  482.  
  483.         The DEFS command allows abbreviating a long command (the string) with
  484.         one or more characters (the symbol).  Some people may be more familiar
  485.         with the term alias in this context.  By using F1...F0 (for F10) and
  486.         SF1...SF0 as the symbol values, the function and shifted function keys
  487.         can be programmed to output strings on the command line. If these
  488.         strings end in the @ character they will be executed, as well.  To be
  489.         expanded into its defined string, a symbol must be the first word on
  490.         the command line.  Before being passed to DOS or to an application the
  491.         command line is scanned recursively, so one symbol can define another.
  492.  
  493.         Example:        DEFS dw dir /w
  494.  
  495.         Here, "dw" is the <symbol> and "dir /w" the <string>.
  496.  
  497.         Example:    DEFS F1 c:\dos\help.com
  498.  
  499.         Hitting F1 will now put "c:\dos\help.com" on the command line.  If
  500.         an @ character appeared after the definition,  the line would also
  501.         be executed without the need to hit Enter.
  502.  
  503.  
  504.         DEFM ... ENDM
  505.  
  506.         Multi-line command macros are created by issuing the DEFM macro-name
  507.         command.  Each line is terminated by hitting Enter, and the macro is
  508.         terminated with the ENDM command.  Macro command lines may contain
  509.         parameters, which are designated by %n (n is a numeral from 1-9).
  510.         Parameters are processed much as in DOS batch files.   Up to nine
  511.         parameters can be defined in this way.  If you don't want a %n
  512.         sequence in a macro to be treated as a parameter,  simply indicate the
  513.         % character as %%.  Macros and symbols also support the use of string
  514.         variables, which must be enclosed within % signs.
  515.  
  516.         Macros support many DOS batch file commands such as ECHO, PAUSE, IF,
  517.         and FOR (but not GOTO or SHIFT).  Embedded spaces and tabs in macro
  518.         command line arguments must be enclosed in pairs of quotes ("). Macros
  519.         cannot be nested, and one macro can call another only from the last
  520.         line before ENDM.
  521.  
  522.         Macros and symbols may be deleted by name with the DELM and DELS
  523.         commands, respectively, and the respective CMDEDIT buffers can be
  524.         cleared and reset with the RSTHIST, RSTSYM, RSTDIR, and RSTMAC
  525.         commands.
  526.  
  527.  
  528.         BACK
  529.  
  530.         Changes to the previous directory entered via one of CMDEDIT's other
  531.         directory changing commands (e.g. CHD or even BACK itself).  The
  532.         directory does not need to be on the directory stack (i.e. you do not
  533.         need to use PUSHD).
  534.  
  535.  
  536.         CHD [d:][path]
  537.  
  538.         The CHD command allows changing to a drive and directory
  539.         simultaneously without affecting the directory stack.  It also
  540.         accepts a trailing backslash on directory names.
  541.  
  542.  
  543.         PUSHD [d:][path]
  544.         POPD  [d:][path]
  545.  
  546.         The PUSHD command changes to the specified directory and stacks the
  547.         previous drive/path name on the directory stack. If at least one path
  548.         has been pushed into this buffer, entering PUSHD without parameters
  549.         toggles between the current and the last stored pair. POPD changes to
  550.         the last drive/directory pair and removes it from the stack.  See also
  551.         the BACK command.
  552.  
  553.  
  554.         DELM,  DELS
  555.         RSTHIST,  RSTSYM,  RSTDIR,  RSTMAC
  556.         HISTORY,  CMDSTAT,  DIRS
  557.  
  558.         Macros and symbols may be deleted by name with the commands DELM and
  559.         DELS, respectively, and the respective CMDEDIT buffers can be cleared
  560.         and reset with the RSTHIST, RSTSYM, RSTDIR, and RSTMAC commands. The
  561.         contents or the buffers can be listed with the HISTORY, CMDSTAT and
  562.         DIRS commands.
  563.  
  564.  
  565.         @
  566.  
  567.         When used at the start of a line, @ is a special command line
  568.         modifier which asks CMDEDIT to "dosify" the line.  CMDEDIT will
  569.         replace / by \,  leading -'s by / and remove trailing
  570.         backslashes from the line. This can be useful if you are used to
  571.         UNIX conventions,  or to avoid trailing backslash errors.
  572.         It is possible to use @ in symbol definitions to automatically dosify
  573.         lines when particular commands are used,  for example:
  574.                 defs rd @rd
  575.         Be careful if you do this for commands that have switches however.  If
  576.         you then use / as the switch character,  it will be changed to \ which
  577.         is probably not what you wanted.  You are safe only if you always use
  578.         '-' as the switch character.
  579.  
  580.  
  581. INITIALIZATION FILE
  582.  
  583.         An initialization file can be used to load regularly-used macros and
  584.         symbols via the /f command line option.
  585.  
  586.         In initialization files,  lines beginning with a minus (-) are comment
  587.         lines.  Blank lines are ignored unless they are part of a macro
  588.         definition.  The file can contain macro and symbol definitions.  It
  589.         may also contain the CMDEDIT commands PUSHD, POPD and CHD,  but must
  590.         not contain any other commands, or CMDEDIT will exit with an error
  591.         message.  The format of the commands in the file is the same as if you
  592.         typed them from the command prompt.
  593.  
  594.         Note that the ENDM command is followed by the macro name it
  595.         terminates. This is optional, as CMDEDIT ignores all following
  596.         characters on a line whose first word is ENDM.
  597.  
  598.         When defining macros and symbols, keep in mind the important
  599.         differences in the way command line arguments are handled. With a
  600.         symbol, the rest of the command line is appended to the definition
  601.         string when it is executed.  A macro on the other hand uses the %n
  602.         parameters like DOS batch files.  Thus the following are essentially
  603.         equivalent:
  604.  
  605.         defs d dir/w
  606.  
  607.         and
  608.  
  609.         defm d
  610.         dir/w %1 %2 %3 %4 %5 %6 %7 %8 %9
  611.         endm
  612.  
  613.         But without the %n's, the macro definition would ignore any command
  614.         line arguments.
  615.  
  616.         Note also that CMDEDIT will abort with an error if a CTRL-Z end of
  617.         file character is at the end of a command file,  unless that line is a
  618.         comment.  Since most editors put an EOF character at the end of a
  619.         file,  you should always make the first character on the very last
  620.         line of a command file a minus sign.  Make sure you don't hit return
  621.         at the end of the last line!
  622.  
  623.         See also the example initialization file CMDEDIT.CFG.
  624.  
  625.  
  626. WINDOWS 3.x
  627.  
  628.         If loaded prior to starting Windows 3.x, CMDEDIT becomes unstable
  629.         when running more than one DOS session.  This can sometimes result
  630.         in Windows terminating a DOS session with a system integrity
  631.         violation message as soon as a key is struck!  There is a work
  632.         around to this bug, the trick being to un-install CMDEDIT prior to
  633.         loading Windows,  and then install it when you open each DOS shell.
  634.         This can be done from batch files as follows:
  635.  
  636.         First, start Windows using two batch files similar to the example
  637.         below.
  638.  
  639.         WIN.BAT:
  640.  
  641.                 @echo off
  642.                 cmdedit /u
  643.                 win2 %1 %2 %3 %4 %5 %6 %7 %8 %9
  644.  
  645.         WIN2.BAT:
  646.  
  647.                 @echo off
  648.                 c:\windows\win %1 %2 %3 %4 %5 %6 %7 %8 %9
  649.                 cmdedit
  650.  
  651.         These batch files assume CMDEDIT was the last TSR loaded into
  652.         conventional memory.  Two batch files are used to ensure the memory
  653.         used by CMDEDIT is actually made available to Windows when it loads.
  654.         Now when you open a DOS session do not just load COMMAND.COM. Instead
  655.         change the properties of your DOS icon to run the following batch
  656.         file:
  657.  
  658.         WINAUTO.BAT:
  659.  
  660.                 @echo off
  661.                 cmdedit /n
  662.                 c:\command /e:1024
  663.  
  664.         You can customise this as you please.  I actually call a batch
  665.         file to start CMDEDIT with a number of switches and an initialization
  666.         file.  The /n switch is used here because I have found when running
  667.         Windows 3.0 that on some occasions when closing a DOS session and
  668.         immediately opening another, CMDEDIT incorrectly reports that it is
  669.         already installed.  You should however read the notes regarding /n
  670.         before using this switch.
  671.  
  672.         The last line of WINAUTO.BAT prevents the session terminating and
  673.         returning to the program manager at the end of the batch file (the
  674.         /e:1024 is simply my preferred environment size).  Note that in
  675.         WINAUTO.BAT it is quite OK to load CMDEDIT into high memory using
  676.         DOS 5 or QEMM or some other loadhi utility (assuming you will not be
  677.         changing the CMDEDIT installed options in the DOS session).  You
  678.         should not load CMDEDIT into high memory before starting Windows,
  679.         however, since then it cannot be un-installed (unless you use one of
  680.         the more advanced Mark and Release programs).
  681.  
  682.         As an aside, notice that the procedure documented above can be
  683.         extended to include disabling/enabling of a DOS screen saver if you
  684.         use one.  You should not have a DOS screen saver running prior to
  685.         starting Windows, but it is fine to start one in a DOS session
  686.         (so long as the session does not run in the background).
  687.  
  688.         At the time of writing,  CMDEDIT has been tested under Windows 3.0 and
  689.         3.1 using the technique described above,  and no problems have been
  690.         encountered.
  691.  
  692.  
  693. MISCELLANEOUS
  694.  
  695.         - Option toggling after installation
  696.  
  697.         The following switches can be used to toggle or change options after
  698.         CMDEDIT has been installed:
  699.  
  700.                     /a /c /g /i /l /o /p /r /t /w and /z.
  701.  
  702.         Any other switches will cause an error if used after CMDEDIT has
  703.         already been installed.
  704.  
  705.         For example,  to turn the beep off/on,  use  CMDEDIT /g.
  706.  
  707.  
  708.         - Customising CMDEDIT control keys
  709.  
  710.         The CMDEDIT control keys may be customised using the CMDCFG
  711.         program.  See CMDCFG.DOC for more details.
  712.  
  713.  
  714.         - Avoiding conflict in other programs
  715.  
  716.         The /t and /z switches were added for the benefit of some programs
  717.         which have an interactive command input mode in which CMDEDIT is still
  718.         active.  In these cases, symbol expansion is probably not desired as
  719.         it could conflict with the other program's own commands. Auto-recall
  720.         mode can also lead to similar problems.  In some cases, the regular
  721.         history facility may also interfere, in which case you should use the
  722.         option /z to disable CMDEDIT completely.  When these problems are
  723.         known to occur it is probably a good idea to call the application from
  724.         a batch file. Here is an example:
  725.  
  726.         MYEDITOR.BAT :
  727.  
  728.         CMDEDIT /o /t
  729.         REM or CMDEDIT /o /z
  730.         REM
  731.         REM Run application here, e.g.:
  732.         myeditor myfile.txt
  733.         REM
  734.         REM call CMDEDIT with your favourite option now, e.g. :
  735.         CMDEDIT /p" "
  736.  
  737.  
  738. UPGRADING
  739.  
  740.         If you are upgrading from CMDEDIT 2.0 with extensions at v5 (or
  741.         earlier) or CMDEDIT 2.1wd, you should note the following changes:
  742.  
  743.         Upgrading from CMDEDIT2e5:
  744.  
  745.         All command line switches behave as before,  however the old ^T macro
  746.         disable toggle has been moved to ^_ (CTRL-underscore) to accommodate
  747.         the new ^T swap character command.  ^\ (CTRL-backslash) is also new.
  748.         The /a, /y and /x switches are new, as are the internal commands BACK,
  749.         HISTORY, DIRS and @.  The command stack is now cyclic,  and command
  750.         completion will by default list possible matches if more than one. The
  751.         documentation has been further expanded and re-formatted.
  752.  
  753.         Upgrading from CMDEDIT21wd:
  754.  
  755.         All command line switches behave as before except the old /n which has
  756.         been moved to /l.  The following switches are new: /a, /k, /n, /o, /t,
  757.         /x, /y, /w, and /z.  The ^_ (CTRL-underscore) command is new,  as is
  758.         ^\ (CTRL-backslash).  The @ dosify line command is new.  Bugs in the
  759.         installation code have been partially fixed (see also BUGS).  The
  760.         documentation,  as you will by now have noticed,  is also much more
  761.         comprehensive.
  762.  
  763.  
  764. COMPILING THE SOURCE CODE
  765.  
  766.         The complete source code for CMDEDIT is included in this package
  767.         (unless you have obtained an incomplete version from an "unofficial"
  768.         source).  It is not necessary to be able to compile the source code to
  769.         use this program,  as an executable CMDEDIT.COM is already included in
  770.         the package.
  771.  
  772.         To compile you will require a Microsoft compatible assembler.
  773.         Three different "make files" are included:
  774.         MAKE.BAT    - for use with Borland's Turbo Assembler
  775.         MAKECMD.BAT - for use with Microsoft's Macro Assembler
  776.         CMDEDIT.MAK - for use with Microsoft's Quick Assembler
  777.  
  778.         The CMDEDIT.COM included with this release was compiled with TASM,
  779.         which produces slightly smaller code than the Microsoft Quick
  780.         Assembler due to nop squishing.
  781.  
  782.         If you are thinking of modifying the source,  take a look at the
  783.         to-do.doc file.
  784.  
  785.  
  786. VERSION HISTORY
  787.  
  788.         Extensions by D. Abbott - v1 and v2
  789.  
  790.         Never released
  791.  
  792.  
  793.         Extensions by D. Abbott - v3 (Jan 14, 1991)
  794.  
  795.         This version is identical to that published as CMDEDIT v2.0, with the
  796.         exception of the options /c, /l, /w, /o, /t and /z added by David
  797.         Abbott, Nov/Dec 1990.  A bug in the installation code that resulted in
  798.         false reports of an already resident version has also been partially
  799.         fixed.  See also BUGS.
  800.  
  801.  
  802.         Extensions by D. Abbott - v4 (May 11, 1991)
  803.  
  804.         Added the /k switch for the benefit of those used to the Unix C-shell
  805.         'filec' filename completion (which uses the ESC key rather than TAB).
  806.  
  807.  
  808.         Extensions by D. Abbott - v5 (July 14, 1991)
  809.  
  810.         Added the /n switch to counter installation problems in some
  811.         situations where CMDEDIT incorrectly detects that it is already
  812.         installed.  Added instructions for running CMDEDIT with Windows 3.0
  813.  
  814.  
  815.         CMDEDIT 2.1wd (an extension of CMDEDIT 2.0 by W. Davison)
  816.  
  817.         This version,  like D. Abbott's extended version,  was an
  818.         independently developed extension of the original CMDEDIT 2.0.
  819.         It included the additional internal commands BACK, DIRS, and HISTORY,
  820.         as well as the listing of matching filenames when multiple
  821.         possibilities exist.  The command stack was made cyclic,  and this
  822.         version also included command options /c and /n which functioned in a
  823.         similar way to D. Abbott's /c an /l respectively.  A ^T command to
  824.         swap characters under the cursor was also added.
  825.  
  826.  
  827.         Extensions by D. Abbott and W. Davison - v6 (June 1992)
  828.  
  829.         This version is a complete merger by David Abbott,  with the
  830.         co-operation of Wayne Davison,  of the two versions described above.
  831.         All the features of both versions are included,  and some additional
  832.         enhancements and bug fixes have also been made by Wayne and me.  If
  833.         you are upgrading from either of these versions, make sure you read
  834.         the UPGRADING section of this document, which details some minor but
  835.         important changes.  Note also that a control-key customisation program,
  836.         CMDCFG.EXE is also included with this release.
  837.  
  838.  
  839. ACKNOWLEDGEMENTS
  840.  
  841.         Thank you to Sven Guckes from Berlin who helped with the
  842.         documentation.
  843.  
  844.  
  845. BUGS
  846.  
  847.         1) Initialization file.
  848.  
  849.            CMDEDIT /f<filename>
  850.  
  851.         If the file <filename> ends with a ^Z (ASCII 026) then CMDEDIT will
  852.         abort with an error. This error however will not occur if the last
  853.         line is a comment line.  See also INITIALIZATION FILE
  854.  
  855.  
  856.         2) Detection of previous installations.
  857.  
  858.         If CMDEDIT is un-installed with /u,  and then run again, it
  859.         sometimes reports that it is already installed.  The original
  860.         version was worse than this, in that on some machines it would
  861.         report that it had already been installed even when run for the
  862.         first time.  If you encounter either of these problems,  use
  863.         the /n switch to force an initial installation,  but be aware
  864.         that later changing installed options is then dangerous as the
  865.         first incarnation in memory is always detected and hence changed,
  866.         and this may be the spurious detection.
  867.  
  868.  
  869.         3) High memory.
  870.  
  871.         CMDEDIT cannot detect that it has already been loaded if it
  872.         was loaded into high memory by a utility such as QEMM-386. This
  873.         means calling CMDEDIT again to alter an option will instead result
  874.         in a new copy being installed. (You can prevent this by using the
  875.         option /o, in which case nothing at all will happen).
  876.         Please note, that some options have a control key equivalent
  877.         such as /r and /t. These can be used instead.
  878.         If you want the ability to change other options after CMDEDIT is
  879.         loaded, don't put it in high memory.  It is possible to uninstall
  880.         CMDEDIT after loading it in high memory,  but not by its own /u
  881.         command.  Instead you must use one of the more recent Mark & Release
  882.         programs which support marking and releasing of TSRs in high memory.
  883.  
  884.  
  885.         4) Working with other programs with command input mode.
  886.  
  887.         CMDEDIT can sometimes upset the behaviour of programs which have
  888.         a command input mode in which DOS editing keys, and therefore
  889.         CMDEDIT, are still active.  I have seen such a program which takes
  890.         one or two letter commands, and normally won't let you type any more.
  891.         CMDEDIT does let you type more, but then gives a "line too long"
  892.         error.  This could potentially corrupt the display of a program not
  893.         expecting it.  If this occurs,  use the /z toggle to disable
  894.         CMDEDIT before starting your program.
  895.  
  896.         5) Windows 3.x - see section on using CMDEDIT with Microsoft Windows
  897.            in the body of this document.
  898.  
  899.  
  900.               -- Last document change:  June 30,  1992 --
  901.  
  902. EOF
  903. -- 
  904.